<?php
include_once("software.php");

$_util = new utiles();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="css/<?php echo TEMA;?>.css" rel="stylesheet" type="text/css">
<title><?php echo $titulo_seccion;?></title>
</head>
<body onLoad="load_functions();" marginwidth="0" marginheight="4px"
	leftmargin="0" topmargin="4px" bgcolor="#f0f0f0">
<div align="center">
<table width="90%" border="0" align="center" cellpadding="0"
	cellspacing="0" bgcolor="#E9EEF5">
	<tr>
		<td colspan="3">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="3">
		<div align="center">
		<p><strong>BORRANDO REGISTRO...</strong></p>
		</div>
		</td>
	</tr>
</table>
</div>
<?php if (isset($_GET['tabla']) && $_GET['tabla'] != '') {
	?>
<script language="javascript" src="js/funciones_post.js"
	type="text/javascript">
        </script>
	<?php
	$tabla=$_GET['tabla'];
	$nombre_campo = $_GET['nombre_campo'];
	$codigo = $_GET[$_util->codigo_tabla($tabla)];
	$return_page= $_GET['return_page'];

	$where_str_nivel_2 = $_GET['where_str_nivel_2'];
	if ($where_str_nivel_2 == "1"){
		$deleteSQL = sprintf("DELETE FROM %s WHERE padre='%s' AND correlativo='%s'",
		$tabla,
		$_GET['padre'],
		$_GET['correlativo']);
		$codigo = $_GET['padre'];
	} else {
		$deleteSQL = sprintf("DELETE FROM %s WHERE %s=%s",
		$tabla,
		$nombre_campo,
		$_util->GetSQLValueString($codigo, "text"));
	}

	mysql_select_db(DB_NAME, CONEXION);
	// echo $deleteSQL;
	$Result1 = mysql_query($deleteSQL, CONEXION)  or trigger_error(mysql_error(),E_USER_ERROR);
	$_util->bitacora($tabla,$codigo,'borrar');
	?>
<script language="javascript">
            refresh_opener();
        </script>
	<?php } ?>
</body>
</html>
